<?php

namespace Componentes\Model\Dao;

/**
 * Componentes necesarios para el modelado
 */
use Zend\Db\Sql\Sql;
use Zend\Db\TableGateway\AbstractTableGateway;

/**
 * @package Dao
 */
class GenericDAO extends AbstractTableGateway {

    public function getRegistroGeneral($id, $tabla, $dbAdapter) {       
        $sql = new Sql($dbAdapter);
        $select = $sql->select();
        $select->from($tabla);
        $select->where("id = '" . $id . "'");
        $selectString = $sql->getSqlStringForSqlObject($select);
        $adapter = $dbAdapter;
        $results = $adapter->query($selectString, $adapter::QUERY_MODE_EXECUTE);
        return $results;
    }

}
